package com.fancy.learncenter.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;

import com.fancy.learncenter.activity.base.BaseActivity;
import com.fancy.learncenter.adapter.base.CommonRecycleViewAdapter;
import com.fancy.learncenter.adapter.base.CustomViewHold;
import com.superservice.lya.R;

import java.util.ArrayList;

import butterknife.Bind;
import butterknife.ButterKnife;

public class ListTextActivity extends BaseActivity {

    @Bind(R.id.recycleView)
    RecyclerView recycleView;

    CommonRecycleViewAdapter textAdapter;

    ArrayList<String> itemDatas;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_list_text, getResources().getColor(R.color.toolbar_color));
        ButterKnife.bind(this);

        itemDatas = getIntent().getStringArrayListExtra("itemDatas");
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
        linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        recycleView.setLayoutManager(linearLayoutManager);
        textAdapter = new CommonRecycleViewAdapter<String>(this, R.layout.list_text_item, itemDatas) {
            @Override
            public void bindView(CustomViewHold customViewHold, String item, int position) {

            }
        };

        recycleView.setAdapter(textAdapter);
    }



    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

//        if (requestCode == REQUEST_CODE) {
//            String name;
//            switch (resultCode) {
//                case CartoonSelectSchoolActivity.SELECT_SCHOOL_CODE:
//                    name = data.getStringExtra(NAME_KEY);
//
//                    if (!TextUtils.isEmpty(name)) {
//                        schoolName.setText(name);
//                    }
//
//                    schoolID = data.getStringExtra(SCHOOL_ID_KEY);
//                    break;
//                case CartoonSelectTextBookActivity.SELECT_TEXT_BOOK_CODE:
//                    name = data.getStringExtra(NAME_KEY);
//
//                    if (!TextUtils.isEmpty(name)) {
//                        lessonName.setText(name);
//                    }
//
//                    lessonId = data.getStringExtra(SCHOOL_ID_KEY);
//                    break;
//                case CLASS_NAME_CODE:
//                    name = data.getStringExtra(NAME_KEY);
//
//                    if (!TextUtils.isEmpty(name)) {
//                        classroomName.setText(name);
//                        className = name;
//                    }
//
//                    break;
//                case CLASS_DES_CODE:
//                    name = data.getStringExtra(NAME_KEY);
//
//                    if (!TextUtils.isEmpty(name)) {
//                        classDes.setText(name);
//
//                        classDesc = name;
//                    }
//
//                    break;
//                case SelectClassPicActivity.SELECT_CLASS_PIC_CODE:
//                    name = data.getStringExtra(NAME_KEY);
//
//                    if (!TextUtils.isEmpty(name)) {
//                        classPic.setImageURI(name);
//                        picPath = name;
//                    }
//
//                    break;
//            }
//        }

    }

}
